package com.shf.compoment
{
	import mx.controls.DataGrid;

	public class FooterDataGrid extends DataGrid
	{
		public function FooterDataGrid()
	{
		super();
	}

    protected var footer:DataGridFooter;

	protected var footerHeight:int = 24;

    override protected function createChildren():void
    {
        super.createChildren();

        if (!footer)
        {
            footer = new DataGridFooter();
            footer.styleName = this;
            addChild(footer);
        }
    }

    override protected function adjustListContent(unscaledWidth:Number = -1,
                                       unscaledHeight:Number = -1):void
    {
		super.adjustListContent(unscaledWidth, unscaledHeight);
		listContent.setActualSize(listContent.width, listContent.height - (footerHeight));
		footer.setActualSize(listContent.width, footerHeight);
		footer.move(listContent.x, listContent.y + listContent.heightExcludingOffsets);

	}

	override public function invalidateDisplayList():void
	{
		super.invalidateDisplayList();
		if (footer)
			footer.invalidateDisplayList();
	}

		
	}
}